package com.example.server.exception;

import com.example.server.constant.ResultCodes;

public class CustomException extends RuntimeException {
    private int errorCode;

    public CustomException(String message, int errorCode) {
        super(message);
        this.errorCode = errorCode;
    }

    public CustomException(ResultCodes resultCodes) {
        this(resultCodes.getMessage(), resultCodes.getCode());
    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }
}
